package com.ixuea.courses.mycloudmusicapisp.controller.v2;

import com.ixuea.courses.mycloudmusicapisp.domain.Version;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 监控控制器
 */
@RequestMapping("/v2")
@RestController
public class MonitorControllerV2 {

    /**
     * 版本对象
     */
    @Autowired
    private Version version;

    /**
     * 版本信息
     * @return
     */
    @GetMapping("/monitors/version")
    private Object version() {
        //重新设置版本
        version.setName(version.getName()+"-v2");

        return version;
    }


}
